/****************************************************
          File Name:msgctl.c
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Thu 11 Sep 2014 10:19:45 AM CST
*****************************************************/

#include"msg.h"

int main(int argc,char *argv[])
{
    int status;
    
    if(argc<2)
    {
        printf("%s msgid\n",argv[0]);
        exit(1);
    }
    status=msgctl(atoi(argv[1]),IPC_RMID,NULL);

    if(status==-1)
        err("msgctl");

    return 0;
}

